<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE topic
  PUBLIC "-//OASIS//DTD DITA Composite//EN" "ditabase.dtd">
<topic id="topic1" xml:lang="en">
  <title id="ha143896">pg_partition_columns</title>
  <body>
    <p>The <codeph>pg_partition_columns</codeph> system view is used to show the partition key
      columns of a partitioned table.</p>
    <table id="ha179967">
      <title>pg_catalog.pg_partition_columns</title>
      <tgroup cols="4">
        <colspec colnum="1" colname="col1" colwidth="172.5pt"/>
        <colspec colnum="2" colname="col2" colwidth="69pt"/>
        <colspec colnum="3" colname="col3" colwidth="85pt"/>
        <colspec colnum="4" colname="col4" colwidth="147pt"/>
        <thead>
          <row>
            <entry colname="col1">column</entry>
            <entry colname="col2">type</entry>
            <entry colname="col3">references</entry>
            <entry colname="col4">description</entry>
          </row>
        </thead>
        <tbody>
          <row>
            <entry colname="col1">
              <codeph>schemaname</codeph>
            </entry>
            <entry colname="col2">name</entry>
            <entry colname="col3"/>
            <entry colname="col4">The name of the schema the partitioned table is in.</entry>
          </row>
          <row>
            <entry colname="col1">
              <codeph>tablename</codeph>
            </entry>
            <entry colname="col2">name</entry>
            <entry colname="col3"/>
            <entry colname="col4">The table name of the top-level parent table.</entry>
          </row>
          <row>
            <entry colname="col1">
              <codeph>columnname</codeph>
            </entry>
            <entry colname="col2">name</entry>
            <entry colname="col3"/>
            <entry colname="col4">The name of the partition key column.</entry>
          </row>
          <row>
            <entry colname="col1">
              <codeph>partitionlevel</codeph>
            </entry>
            <entry colname="col2">smallint</entry>
            <entry colname="col3"/>
            <entry colname="col4">The level of this subpartition in the hierarchy.</entry>
          </row>
          <row>
            <entry colname="col1">
              <codeph>position_in_partition_key</codeph>
            </entry>
            <entry colname="col2">integer</entry>
            <entry colname="col3"/>
            <entry colname="col4">For list partitions you can have a composite (multi-column)
              partition key. This shows the position of the column in a composite key.</entry>
          </row>
        </tbody>
      </tgroup>
    </table>
  </body>
</topic>
